<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>${pageTitle }</title>

		<meta name="description" content="User login page" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<link rel="stylesheet" href="${resRoot}/plugin/ace-v1.3/assets/css/bootstrap.min.css" />
<link rel="stylesheet" href="${resRoot}/plugin/ace-v1.3/assets/css/ace.min.css" />

<script type="text/javascript">
	if (window.parent != self) {
		alert('session已过期，请重新登录');
		window.parent.parent.location.href = 'login.htm';
	}
</script>
</head>

	<body class="login-layout" onload="document.getElementById('userName').focus();">
		<div class="main-container">
			<div class="main-content">
				<div class="row">
					<div class="col-sm-10 col-sm-offset-1">
						<div class="login-container">
							
							<div class="space-20"></div>
							<div class="space-20"></div>
							<div class="space-20"></div>
							<div class="space-20"></div>
<h2 align="right">
									
																	</h2>
							<div class="position-relative">
								<div id="login-box" class="login-box visible widget-box no-border">
									<div class="widget-body">
										<div class="widget-main">
											<h4 class="header blue lighter bigger">
												<i class="ace-icon fa fa-key green"></i>
												系统登录
											</h4>

											<div class="space-6"></div>

											<form id="loginForm"  method="post" onSubmit="userLogin();">
												<fieldset>
												<label id="error_msg" class="inline red" style="font-size:10pt;">
															
														</label>
													<label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="text" class="form-control" name="userName" id="userName" placeholder="用户名" />
															<i class="ace-icon fa fa-user"></i>
														</span>
													</label>

													<label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="password" class="form-control" name="pwd" id="pwd" placeholder="密码" />
															<i class="ace-icon fa fa-lock"></i>
														</span>
													</label>

													<div class="space"></div>

													<div class="clearfix">

														<input type="submit" id="btn_login" class="width-30 pull-right btn btn-sm btn-primary" value="登 录 ">
															
													</div>

													<div class="space-4"></div>
												</fieldset>
											</form>

											
										</div><!-- /.widget-main -->

										<div class="toolbar clearfix"  >
											<div>
												
											</div>

											
										</div>
									</div><!-- /.widget-body -->
								</div><!-- /.login-box -->

								<!-- /.forgot-box -->

								<!-- /.signup-box -->
							</div><!-- /.position-relative -->

						<div class="navbar-fixed-top align-center" >
							
						  </div>	
						</div>
					</div><!-- /.col -->
				</div><!-- /.row -->
			</div><!-- /.main-content -->
		</div><!-- /.main-container -->

		<!-- basic scripts -->
		<script type="text/javascript" src="${resRoot}/plugin/ace-v1.3/assets/js/jquery1x.min.js"></script>
		<script type="text/javascript" src="${resRoot }/js/jQuery.md5.js"></script>
		
		<script>
			$(function(){
				//$("#btn_login").click(userLogin);
			});
			$(document).ready(function(){
				var error='${error}';
				$("#error_msg").html(error);	
			});
			function userLogin(){
				var userName=$.trim($("#userName").val());
				var pwd=$.trim($("#pwd").val());
				if(null == userName || ''==userName || null == pwd || ''==pwd){
					$("#error_msg").html("用户名和密码不能为空");	
					return;
				}
				$("#pwd").val($.md5(pwd));
				
				$("#loginForm").attr('action','login.htm');
				//$("#loginForm").submit();  
			}
		</script>
	</body>
</html>

